Socket
Socket
Sign inDemoInstall

write-response

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

write-response

Send a JSON or a text response to an http response object


Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Write Response

Build Status David DM GitHub code size in bytes GitHub package.json version GitHub

Send a response to a native node http(s) response object

Example Usage

json

const writeResponse = require('write-response');
writeResponse(200, { hello: 'all good here' }, response);

text

const writeResponse = require('write-response');
writeResponse(200, 'all good here', response);

with headers

const writeResponse = require('write-response');
writeResponse(200, '<strong>HELLO</strong>', { 'Content-Type': 'text/html' }, response);

License

This project is licensed under the terms of the MIT license.

FAQs

Package last updated on 13 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc